package com.byt.framlib.basemvp.exception;

import com.byt.framlib.commonutils.LogUtils;

import io.reactivex.Observable;
import io.reactivex.functions.Function;


/**
 * 异常处理
 * Created by WZG on 2017/3/23.
 */

public class ExceptionFunc implements Function<Throwable, Observable> {

    @Override
    public Observable apply(Throwable throwable) throws Exception {
        LogUtils.loge("异常:" + throwable.getMessage());
        return Observable.error(FactoryException.analysisExcetpion(throwable));
    }
}
